package com.example.demo.rocketmq;

import org.springframework.messaging.Message;
import org.springframework.messaging.support.MessageBuilder;

public class RocketUtils {

    public static Message<Object> buildMsg(String beanName, String methodName, String parameterTypes, Object msg) {
        return MessageBuilder.withPayload(msg).setHeader("beanName", beanName)
                .setHeader("methodName", methodName)
                .setHeader("parameterTypes", parameterTypes)
                .build();
    }

    public static Message<Object> buildMsg(Object msg) {
        return MessageBuilder.withPayload(msg).build();
    }
}
